package com.huixuebao.exchange.controller.policy;


import com.huixuebao.common.bean.ApiResult;
import com.huixuebao.exchange.dto.PurposeDTO;
import com.huixuebao.exchange.service.InsuredService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RestController
@RequestMapping("/exchangeApi/policy")
public class PolicyController {

    @Autowired
    InsuredService insuredService;

    /**
     * 获取保单列表
     * @param userId
     * @param settleState
     * @return
     */
    @GetMapping("/getPolicyList")
    public ApiResult getPolicyList(String userId,String settleState){

        return insuredService.getPolicyList(userId,settleState);
    }

    /**
     * 添加团购信息
     * @param purposeDTO
     * @return
     */
    @PostMapping("/addPurpose")
    public ApiResult addPurpose(@RequestBody PurposeDTO purposeDTO){
        return insuredService.addPurpose(purposeDTO);
    }
}
